{{ define "admin/access/edit.html" }}
{{ template "admin/common/page_header.html" .}}


<div class="row">
    <div class="col-lg-12">
        <div class="card">
            <header class="card-header">
                修改权限
            </header>
            <div class="card-body">
                <form action="/admin/access/doEdit" method="post">
                    <input name="id"  type="hidden" value="{{.access.Id}}"/>
                    <div class="form-group row">
                        <label class="col-sm-2 control-label"  for="module_name">模块名称</label>
                        <div class="col-sm-10">
                            <input type="text" class="form-control" id="module_name" name="module_name" value="{{.access.ModuleName}}" placeholder="模块名称">
                        </div>
                    </div>

                    <div class="form-group row">
                        <label class="col-sm-2 control-label" for="type">节点类型</label>
                        <div class="col-sm-10">
                            <select name="type" id="type" class="form-control">
                                <option {{if eq .access.Type 1}} selected {{end}} value="1">模块</option>
                                <option {{if eq .access.Type 2}} selected {{end}} value="2">菜单</option>
                                <option {{if eq .access.Type 3}} selected {{end}} value="3">操作</option>
                            </select>
                        </div>
                    </div>

                    <div class="form-group row">
                        <label class="col-sm-2 control-label" for="action_name">操作名称</label>
                        <div class="col-sm-10">
                            <input type="text" class="form-control" id="action_name" name="action_name" autocomplete="off" value="{{.access.ActionName}}"  placeholder="操作名称">
                        </div>
                    </div>

                    <div class="form-group row">
                        <label class="col-sm-2 control-label" for="url">操作地址</label>
                        <div class="col-sm-10">
                            <input type="text" class="form-control" id="url" name="url" value="{{.access.Url}}" placeholder="操作地址">
                        </div>
                    </div>

                    <div class="form-group row">
                        <label class="col-sm-2 control-label" for="module_name">顶级模块</label>
                        <div class="col-sm-10">
                            <select name="module_id" id="module_id" class="form-control">
                                <option value="0">---顶级模块--</option>
                                {{$moduleId := .access.ModuleId}}
                                {{range $key,$value := .accessList}}
                                    <option {{if eq $value.Id $moduleId}} selected {{end}} value="{{$value.Id}}">{{$value.ModuleName}}</option>
                                {{end}}
                            </select>
                        </div>
                    </div>


                    <div class="form-group row">
                        <label class="col-sm-2 control-label" for="sort">排　　序</label>
                        <div class="col-sm-10">
                            <input type="text" class="form-control" id="sort" name="sort" value="{{.access.Sort}}" placeholder="操作地址">
                        </div>
                    </div>

                    <div class="form-group row">
                        <label class="col-sm-2 control-label" for="description">描　　述</label>
                        <div class="col-sm-10">
                            <textarea class="form-control" id="description" name="description" placeholder="操作地址">{{.access.Description}}</textarea>
                        </div>
                    </div>

                    <div class="form-group row">
                        <label class="col-sm-2 control-label" for="status">状　　态</label>
                        <div class="col-sm-10">
                            <div class="clearfix">
                                <div class="custom-control custom-radio custom-control-inline">
                                    <input type="radio" id="statusOne" name="status" class="custom-control-input" {{if eq .access.Status 1}} checked {{end}} value="1">
                                    <label class="custom-control-label" for="statusOne">显示</label>
                                </div>
                                <div class="custom-control custom-radio custom-control-inline">
                                    <input type="radio" id="statusTwo" name="status" class="custom-control-input" {{if eq .access.Status 0}} checked {{end}}="0">
                                    <label class="custom-control-label" for="statusTwo">隐藏</label>
                                </div>
                            </div>
                        </div>
                    </div>

                    <div class="form-group col-md-12">
                        <button type="submit" class="btn btn-primary ajax-post" target-form="add-form">确 定</button>
                        <button type="button" class="btn btn-default" onclick="javascript:history.back(-1);return false;">返 回</button>
                    </div>
                </form>
            </div>
        </div>
    </div>
</div>


{{end}}